﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace BadHabit.Factory.Controls {

    /// <summary>
    /// Interaction logic for WhiteBoardPanel.xaml
    /// </summary>
    public partial class TaskPanel : TaskPanelBase {
      
        /// <summary>
        /// Default Constructor.
        /// </summary>
        public TaskPanel() {
            InitializeComponent();            
        }


        private void Paste_Executed(object sender, ExecutedRoutedEventArgs e) {
            string[] tasksToPaste = GetTasksFromClipBoard();
            if (tasksToPaste == null || tasksToPaste.Length == 0)
                return;

            taskDataGrid.PasteTasks(tasksToPaste);

            
            
        }

        public override bool IsAddingNewOrEditing {
            get {
                BindingListCollectionView view = taskDataGrid.taskDataGrid.ItemsSource as BindingListCollectionView;
                if (view == null)
                    return false;
                return view.IsAddingNew || view.IsEditingItem;
            }
        }
      


    }
}
